From: Jo-Philipp Wich Date: Fri, 19 Jun 2020 12:49:48 +0000 (+0200) Subject: luci-base: template.lua: fix nil access in string template error handling X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=c351beea561acafa088a3fd3d82bfec93ee45cd4;p=project%2Fluci.git luci-base: template.lua: fix nil access in string template error handling Template strings have no associated name, which led to an attempt to concat nil with a string when formatting the error message in case of exceptions. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/luasrc/template.lua b/modules/luci-base/luasrc/template.lua index ed46f50753..cd9b73b22b 100644 --- a/modules/luci-base/luasrc/template.lua +++ b/modules/luci-base/luasrc/template.lua @@ -71,7 +71,7 @@ function Template.__init__(self, name, template) -- If we have no valid template throw error, otherwise cache the template if not self.template then - error("Failed to load template '" .. name .. "'.\n" .. + error("Failed to load template '" .. self.name .. "'.\n" .. "Error while parsing template '" .. sourcefile .. "':\n" .. (err or "Unknown syntax error")) elseif name then